﻿using DBVisitor.DBProvider;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DBVisitor
{
    public class DBService
    {
        protected DBAccessAbstractProvider Provider { get; set; }
        protected DBService(DBAccessAbstractProvider provider)
        {
            Provider = provider;
        }
        public static DBService CreateService<TDBConn>(DBAccessProvider<TDBConn> provider) where TDBConn : IDbConnection
        {
            return new DBService(provider);
        }
        public TableService<RowType> CreateTableService<RowType>() where RowType : new()
        {
            return TableService<RowType>.CreateTableService(Provider);
        }
    }
}
